<template>
  <svg :style="`width: ${width}; height: ${height}`">
    <use :fill="color" :xlink:href="prefix + name"></use>
  </svg>
</template>

<script setup lang="ts">
//接受父组件传来的参数
defineProps({
  //xlink:href属性值的前缀
  prefix: {
    type: String,
    default: "#icon-",
  },
  //提供使用的图表名字
  name: String,
  //接受父组件提供的颜色
  color: {
    type: String,
    default: "",
  },
  width: {
    type: String,
    default: "16px",
  },
  height: {
    type: String,
    default: "16px",
  },
})
</script>

<style scoped></style>
